All code works as described by the specification. May need more comments.