re-organized and added example