Cleaning code and fixing outOfMemory bug
All Bugs fixed