incorporate some of #83