simplified conditional, now functional