clean KDE code
more edits
clean API and add documentation for RM3 and KDE codes
little updates