problems with main function