Make it work for 1 level of nesting