Calculating port in a different way