Added final function definitions in pff_output. Didn't start debugging yet.