remove useless code, added input for ip address