split off kde.py, added more documentation