a version that works with bytes