Documentation

Organized and documented the .cpp file