added flatMap, forEachRight, sum, product, min and max methods