portability stuff, tweaked unitbuildingmodule