add threshold as argument