fixed lots of offset bugs