added function to append retrieved cursor coords in coords buffer