Added weighted version of DP.
Added weighted version of DP, hooked this up to main functionality.