with comments, formatting of output, and has been tested