algorithm update to test 2 level nested objects