Improved if/then statements. Changed spaces to tabs