Implemented Luke's keyPress code