Implemented caching and drastically sped things up