Added some comments
Added new version with grid class
Cleanup
Cleanup
Use a smart pointer to trigger automatic deletion when out of scope