Quick cleanup branch pull request

I've added a lot of code in the knowledge base that will not be used, unfortunately. I've tried to neaten up the program section for quality calculations instead, that became somewhat more readable. I've also finetuned some qualities.