big buffering optimization, added some code documentation