Add the caching precalculator (great speed improvement!)

Signed-off-by: Tobias Markus <tobias@markus-regensburg.de>