Add comments to explain code
Add explicit c++11 nullptr asignment