converted linear search to work with strings