Made the read-loop non-blocking, and added 'join'