added the fprintf function