modified code to use different ports