add method to replace letters in an array