printing SP to file