Added layer stack structure for initial layers, mapped with recursive function