Added scurve generator
Some readability and code quality improvements