NF: add function to find true cost associated with thresholded array (and tests), doc cleaning