change function to main