no more memory leaks and new struct to use less memory