update render() funciton to accept parameters