Initial version for HW3. lrCostFunction.m implemented: