Binary tree problem solved