Added test function read_backspace and read_enter and reorganized the code