a sub-algo example