added functions to receive Output commands and changed lots of code for broader functionality
still untested, not usable atm
this is my first "working" version