fix make_shared statements,
add output of curves
calculate before returning curve (may be empty otherwise)