Working on alg 1