add replace and filterArray methods