Histogram bug fixed. Problem was with changes we'd made in the sd function.