changed if/else