Add buffer manipulation functions