adds given string to end of array if string exists in array
iterates through array of hashes and puts values