Fixed Standard deviation calculation and made it consistant.