Made changes described in the above comment. Feel free to adjust as desired. Resolves #100.