Functionality to move cursor, screen is not clearing right