fixing bug when writing exactly to end of memory
fixed getting user input