removed debugging print statements
Added local cache.