update script to allow both clean and debug at the same time
parsing all communications received from tcp connection