Lab 4 example code