Added port mapping function