main file written