Reformatted and added more documentation.