adding rearrange fields method and testing it