beginning of render entry function --KW