Added getNearestOccurence to calculator