Added documentation and cleaned up the random list of port management