cleaned up unnecessary code and added strcasecmp to function to provide case insensitive string comparisons