added some comment and modified z+1 in z+2 for levels handling