now calls the main function in the specified argument, passing the history array