Immediate treatment of a stroke is one of the most important factors in recovery, as it can significantly limit brain damage. The greatest functional gains occur in the first three months after a stroke. Patients may regain lost functions through training, or they may learn ways to compensate for lost skills. Sometimes, during the early months, they experience spontaneous recovery of an ability that seemed lost. The pace of recovery slows markedly by six months, although gains are still possible thereafter.