Just a little tip, you don't have to use it though...

if ($3 != $null) is the same as if ($3)

Because you're checking if $3 is not equal to $null/$false. Which is the same because it only triggers if it's $true.

The same goes for checking to see if it is $null/$false only this time prefix it with an exclamation mark.

if ($2 == $null) is the same as if ([color:red]!$2)[/color]