replaced double quotes with single quotes, added error handling for unsupported unit types (xx-small, x-small, small, large, etc.)