-fix some memory questions
-make it use less memory