implemented gaussian stuff