Added fprintf function