fixed port number handling, removed PORT variable
redesign