example code for UMW's CPSC 230