Make debug mode more efficient + add comments #1