clean up offset calculation (now works with ISIS databases from isis.dll),