fixes to max, min, and sum functions and their addition to utils.cu