tried to fix gaussian fitting