add descending, plus tests

also added license file (COPYING)