ch2-functions fixed