Fixes mismatch xvalues/yvalues length
Stops simulation after max runtime