Added if function