implement Occurances func, add according testcase