Declare your variable in the beginning of your script if you know you're gonna test it later. Don't give it a value at this point. A declared variable that has not been assigned a value will have the value 'null'. Use the === compare operator to check whether the variable is really boolean false. The == operator is not reliable as a value of 0 will also evaluate to false. (Basically, the === asks whether variable are of same value AND datatype!).
Nitrogen Fixation. Nitrogen fixation refers to the conversion of atmospheric nitrogen gas (N 2 ) into a form usable by plants and other organisms. Nitrogen fixation is conducted by a variety of bacteria, both as free-living organisms and in symbiotic association with plants. Because it is the principal source of the nitrogen in the soil, nitrogen that plants need to grow, nitrogen fixation is one of the most important biochemical processes on Earth.
1 Nitrogen is converted from atmospheric nitrogen (N2) into usable forms, such as NO2-, in a process known as fixation. The majority of nitrogen is fixed by bacteria, most of which are symbiotic with plants.  Recently fixed ammonia is then converted to biologically useful forms by specialized bacteria.