added build function and general migl improvements