Simplify and Memory Error Fix