Rewritten test to just check for possible combinations
Replaced else { if ()...} with elseif() {}
Fixed cs