if -> else if and removed unnecessary continues