Main Code Added

Code with main function added.