Adds method for saving weights