main function should accept file name as parameter