Fix typo in README
Cleanup code a bit; add some useful comments