added ability to flip leaves
resolved merge