added basic support for offset indices
prepare to merge