fixing averaging and adding script to test new weights