checking in the code discussed in #29 in a temp branch