This version runs even faster!
I am going to add volumes for cost.

Signed-off-by: ezheng <ezheng@cs.unc.edu>