Added docs and updated formatting