Added Emyr's changes to fit the s-curves