render parents in the correct order