Some example code based on quickstart tutorial