See note above about initialization of threshold only to pass directly to function