fixed key mapping
merged dan and my stuff