Change weight into a float so that we can take into account the