changed else/if to else if