Added debug utilities, corrected standard deviation calculation