code for port reading testing