added port vars and used them