Implemented debug levels to already existing code
Removed bug where an array would be left uninitialized