changed input commands, added some comments, rearranged some classes