this is the latest code imported from the Widget2.0 branch