improved compiling
added memory management
optimized code