First assignment done

Finished the missing pieces and should now work properly. Added some
more tests.