started coding n=0; added port list