Moved debug out of index.html for better code review