Rewrote render function to work with new data.