algorithm and front end highlighting working