changed bindings to handle buffers better