implemented most of traceviz