initialize data array, fix render function