Solving the Flatness Problem