Added in debugging code to work out why the network is not learning