Repaired depth check to accommodate standard z-axis orientation.
Re-synchronized time value written to output such that output t
reflects time *after* processes are complete.