Starting to write main function