Buffer bounds in js instead