Ported offset() and offset2()