BS-3-22 Generalization and speed up of an optical plug and play technique