Hello.
You made your logic complex. Lets say I am checking for a condition 'c1' to be true, this is enough.

if(c1 == true) {
// do something
}
else {
// do something
}