06: major refactor, no smaller commits, tested, works mostly
06: fixed line length