some example code building off bshaffers github repository