nit: I would prefer you call this variable `bytes_to_read`.