Added docs and better formatting