added function descriptions, added averaging to box integral