Get rid of main function from sample code