Corrected minor bugs, improved speed

Now you can set memory usage