threshold works for now, can be improved