use array to replace