fixed arithmatic in port calculations