Bug fixes in Precalculation, Redundant Code tested and neccessary parts added