the whole trace loop is implemented. Works like shit