Worked on clustering.

I also did some code cleanup.
Fixed typo in the gitignore file.