Plan to save millions of homes from foreclosure in works