changed the smoothstep function to correct one