test  code from some dev book