Fixing Performance & Memory problems

Profiling