Adding changes to allow users to specify their own port