started on checkOccurrences R file