remove unused variable
simplify handling of modifier keys
remove commented out function