Cleaned up the createATree method.