add flatten to leaf and tree
Add crossover and basic testing