Closes #2. Not very neat, but it will do.