Added code for updating the weights and loading in a file.