tidied up a few more things; added discussion on trees along with code
fixed merge problems