Added logic for rendering data