more changes
added weight variable to global init