Communication with PC added. Code tidied up