added exanded grad_desc version