fixed sorting
cleanup
refactoring highlight logic