added new function for rendering