Removal of redundant code
Added some doc