Added precalculated values and moved variables to static.