cleaned the code a little, changed key handling to keep a Set of down keys.