just before change to joint prob
just before changing gate functions
changed gate function to gaussian