changed weight vector to float