Changed function signature to reflect buffer API