added comments and removed the caching parts