putting on github in case it is useful to anyone