# Can a Morse function define a unique structure on a closed manifold?

I was thinking about the doubt that if $M$ and $N$ are closed manifold and if there exists two Morse function $f$ and $g$ respectively on $M$ and $N$ with the following property that they both have same number of $i$ index critical points for each $i\in \mathbb N$, then whether I can conclude they are homeomorphic or not.

It is clear that they are of same dimension since the maximum of $f$ and $g$ are of same index. And we know that if a closed manifold has exactly two critical points then it is homeomorphic with $S^n$.

But still I don't expect an positive answer for my doubt. So to find a contradiction I was thinking about handle decomposition of some closed manifold. And now I got stuck with this doubt that suppose I have a handle decomposition of a closed manifold $X$, then can I construct a Morse function $f$ on $X$ such that corresponding to this Morse function I get the same handle representation?? This is kind of converse of Morse handle presentation theorem. So far I could not able to construct such a function.

And also I could not able to find any counter example for my initial doubts.

It'll be very helpful if someone clarify my these two doubts.

In looking for counter-examples it helps to notice that $M$ and $N$ have CW structures with the same numbers of $i$ cells, and hence they have the same Euler characteristic.
It turns out that there is a Morse function on the Klein bottle with critical points of index $0, 1, 1, 2$, so together with the standard height function on the 2-torus we get a counter-example. This is explained at the end of these notes by Michael Landry.