making inflexion spike detector more robust