better output and bugfix