Qualityoflife

This is a re-commit of an improved version of 4ac6739 with some additional changes. See each commit for details.