Modified the writeProgram by deleting one of the unneccesary parameter and corrected it test code