I do not understand why that line is necessary. If the boolean is checking for Y to be true or false, why do i need to return false at the end?
A bool type function (or method) requires you to return something. If you do not, There will be an error.
So by default, it returns false. If by default it will return true, it might make certain things check out even when you did not intend.
That is how I understand it.