added logic to remove uneeded array nestings in teh results of execute