Revert "added functions to main switch"

This reverts commit fcda449ada365cb6b3af6b8bc1e2e559549a56c2.
Revert "Revert "added functions to main switch""

This reverts commit f91eea60c03139f6395b536370126b0edd2110cd.
changed the recvmessage command to use polling

recvmessage still needs to get tightened up a bit