modified from kliment for the Prusa Mendel I2.