more edits
clean API and add documentation for RM3 and KDE codes