main program implemented'