improved modbuild script