add code to main