added logic to jump record boundaries if need be