document main
think some more about automatically generating tests