Fixed updateLayer, now I just have to fix updateNetwork.