support bit type
refactored convertVals function0