update generate method to take file path to allow for testing