Fixed arithmetic issue on Mega1mpact's merge
Added basic caching, to be fixed (Currently broken/non-functional)