Addition of some state change tracking
Adding some sample source code from another repo