intersectPenalty function added