removed old functions
organized main