Adding function for port count