Added sum function to utils.h