changes for addition od middle layer