changes in level 2; fixing the states switch