test from surce code from textbook