implemented hubs2 function, that uses standard deviation for threshold values