Closes #2. First working version.