minor style updates

@manishamde , I made some style updates, mostly on comments and indentation. I believe there are changes I made that are not specified in the official style guide. If you think the origin version is better, please let me know. This PR contains two minor code changes: 

1. centriod -> centroid
2. meanSquaredError calculation