Added some inline docs and formatting