change comment style, location of exports, and update extrema calculations