Fixed equations, deleted some temporary variables to reduce memory usage, used eval() function to improve readability.