Start of render function