bugfixes and better output outputing of the output