Added procedures to main program