Fixed a cursor movement bug and improved performance significantly :)