adding conditional execution with accompanying tests.