new methods, optimizations

optimized code, added a few new methods (memory retention / release -
releated)