added code write competers to a file