Added comment and fixed a bit (previously didn't return all the file that was read to the buffer)