Added buffer functionality