Finished version of the display and cursor syncing routines.