work on render function