paritially implimented main function