Including all modifications for measurements, see SOEMPI repo for changes