first steps toward distributing this
more tweaks