fixed the display-clearing problem by using readline, a standard library