Better memory handling.
Better debug output
CLEAN UP!
