Code cleanup
Updating tutorial and fixing bugs
Merge pull request #2 from nathanathan/gh-pages

Updating tutorial + code cleanup + bug fixes