unfinished TMC code, error with subgradient descend  method.