Changed to substr instead of array like if statement.