updated to new buildFcn, restructured