updating code logic

should help triage and compare elements better. also forget about
sorting.