add prof's code example (partial)