refactor offsets to be relative to the start of data not start of the file (broken)