bug when pressing return and re open application seems to be fixed
cleaned up the code mostly