updates, fix memory leak, still in progress