added cursor highlight function