Changing associative array to if then elses for increased compatibility with older bash. Associative arrays are only available in bash 4.0 and later.