added memoization to ticking and text meauserment functions
 merged