To address memory caching, I added pointers for the comparison variable