add render function to class