fixed dimension bug. Objective still returns zeros.