Added cost function and tried to debug error