wrote a little more main function code