Added receiveCommand and parseCommand functions