Make the NN work for more than 3 layers