renamed main functions to main