spelling fix. last occurrence factory added
added occurence functions