add example code from assignment

for the testing routine