change read to take len paramater.