Update IP.

Add comments
Refactor Code