just a few minor changes, about to pull in shawn's code from main branch