cleaned up tree and fixed some errors