method 3, modified if clause