  We propose a model for modified gravity that meets the conditions of
viability. The model has stable constant curvature solution and for an special
case contains flat space time solution. The model also leads to matter
stability under small perturbations of scalar curvature. We give an example of
restrictions on the parameters that give large enough scalaron mass to avoid
detectable corrections to the Newton's law. The model describes inflation and
late time accelerated expansion with an effective cosmological constant for the
inflationary epoch and small effective cosmological constant for the current
accelerated phase.
