Code examples for steepest descent