Initial code for data binding, need further testing.