removed redundant IF statements