Removed tiles from cache as needed
Using better names for the variables
Simplified logic
Do not remove same tile many times