gaussian function now faster