first skeleton for selector matching and bug fixes in node iterator