Improved memory usage. I removed some useless big arrays