ex04: added cursor movement