Added cursor and improved drawtoscreen function