example code for apue