Refactored the code so that you can now specify the port.