This is used for algs4