better arg reading in alg