cleanup, heavyduty main function