Fixed some comments. Cleaned some magic numbers. Removed unused files.

Also fixed memory leak.