Added and integrated phase switch, using Phase.c & Phase.h