trying a new offset calculation method