Now there is another error, for some reason, the value set if the enum is TOP should be 64 and 128 if it is BOTTOM. However, they are switched. I haven't changed this in the code. Why is it doing this?

There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!