added comments for buffering