move mutate method to Word class