simple programme from book