small cleanup
remove unused variable and print path cost only for required algorithms