working version of rayleigh and klett