CHANGED: set debug to false to make it run slight faster and leave behind less garbage