Added comments, removed debugging code