implemented easier way to handle user input in a generic way (currently not working)
fixed bugs from last commit.