added example and removed debug code