completely reworked trace generator