Final implementation with WDT added