updated weights type from int to double