Added docblocks and Some fixes