split now stores res
added single fit_segs
minor changes to fit_segs