moved fixTraces to the bottom since it's a utility