changes getOffsets to return {x, y} instead of array