MainClass - optimized the code. Duplicate IP entries are looked up in
the HashMap and retrieved rather than getting resolved again.