code optimalize

code optimalize and change a 2 to Port number