main program written