replaced ugly slow string comparions with awksome one liner