Changed num_offsets from a constant to a variable.