Added results caching and made this more error proof :)