adding Track Reference support
nicer duration print
make global variables use var
fix logging