fitting code bug fixes by Rembrandt, exe to be updated