Changed Propagate function in order to integrate with rest of code.