fixing offsets, cleanup