Updated for sdk 3.0+
Merge