QM using propper tree layout