Variable offset calculation almost works as expected