Reworked location offset calculation