add automated port finding code
fix comments