Updated to pass buffer and size!