bug fixes, added visualization