implemented automatic anomoly threshold discovery