fitting code not working yet