Thoroughly tested buffer (hopefully)