minor changes in highlight function