Added forEach and sum functions.