BUGFIX S-curve