fixed a serious miscalculation where I specified a bit offset rather than a byte offset