Working version of 2 levels