Added some docs and reformatted for project style consistency.