making port optional
better job of choosing port