Changes in keyPress method. Added varible lastHeldItem