added isDown function to check for keys in loop