Added nested ifs to test