Played around a little more, I think it is mostly correct now, like I said before it needs some tests. I added some tests for the LRU cache that is baked in