changed to be twt option in time to depth
refactored to be more generic
fixed scaling
updated version