created a function template for relaxed synch MWD with fixed execution
fixed a bug in the relaxed synch code