My first pass at the assignment

Wow, that was harder than I thought… :-)