split out mutateParam function and added sanity test