add and query. sample program