This is a copy of Thomas Keller and Malte Helmert's Prost implementation