added prerequisite code to get example running