For resubmit (review with Prof. Watson)
Handle EOFError
Added unit tests
Merge pull request #40 from im965/master

Resubmit (im965)