remoed gaussion weighting code