Convert keybinding to keypress, and added additional comments and minor param refactoring