Added datagrid building functionality