converted conditional into if statement