updated string comparison method