Dev legions

Bug fixing and add new functionalities