Updated docs and added comments