prob5: alg1: w/ benchmark