improved noise function