get weight recursive