variable is called pattern, need to use the same name for rearrange