@wedaly Moved offset calculation to a separate line.