modified monophyly test and added a bunch of improvements