added functions to receive Output commands and changed lots of code for broader functionality
i wasn't happy with my first code, so i began changing it to be more versatile.
this is my first "working" version