added comments explaining few functions