adding gaussian fitting code