errors fixed from suggestions by commenter on blog post