Implemented right-clicking as a new action. Also simplified the code a bit.