Improvements: mostly in comments, and ensuring it's not broken when it opens. Also, network error handler.