Replaced D with code from C as this code works

Originally copied code from RTSHAB B.  Now replaced with code from
RTSHABC as this code is more upto date