Add docs for getTotal

Added docs for factory method getTotal. Also removed some extraneous whitespace.