Btw you shouldt use if (myBoolean == true) or if (myBoolean == false).
You should use:
if (myBoolean) {
//Means boolean is true
}
or
if (!myBoolean) {
// Means Boolean is false
}
myBoolean stands for "true". So if you write myBoolean == true youre basically writing if (true == true) which returns true. See what i mean
It also makes the code a bit easier to read