Closes #1. First working version.
Resolved merge.