Got rid of .endsWith, replaced with regular expressions