First outline of source code
first apparently working code
Merge pull request #1 from einhverfr/master

first apparently working code, needs more testing