Updated reformatParameters and added Unit Test for this function