finished ch2 demo