Removing debug stuff and adding comments.