Latest build with more error handling and comments.
Comments added and code cleaned up
Fixes #9