init code for algs4