Implemented LEGION and various fix. Allineated to andor-integration