Did you intend to remove the space after "if" in these places?  I much prefer having the space there myself.