reorganized to support multiple examples