Add the promised sample program with error checking.