Add variant.cpp modified for Davinci

Add variant.cpp modified for Davinci