Renamed main R file and added criteria argument