New code for more conditions