tweaked and if expression