Deleted unused variable cweight, fixed debug output.
Fixed debug output