main change is "type.toLowerCase();"