Added comments and some refactorings. Added Cmd+1, Cmd+2 ... hotkeys