Stopped using shared_ptr and updated the style.
Merged old changes