working on numerical stability.