modified primePort routine