optimize controls for levels, fixed bugs regarding levels