Added function to divide variables in bins of equal weights