Started implementing buffering (not complete)