fixed keyboard bugs; added headers