Final comments and memory freeing
Removed debug messages from master.