Switched all places that used where to use filter, and toArray to array.