Cleaned debugging messages, still has bugs.