than before if problems occur -replaced most malloc by MEM2_alloc, as well as free and SAFE_FREE replaced by MEM2_free