added in functionality to handle impulses properly for keyboard input.
merged
fixed player undefined