added weight gradient