normalize weights matrix

normalize weights matrix using weights matrix