added count-leaves and pair?
removed obsolete code
solved deep-reverse