added code to receive commands via network