working on nested relations