Basic functionality is corrct, but doesn't handle rapid keypress very well