Implemented (but not tested!) port reading