take horizontal, vertical offsets into account (perhaps wrongly)