Added weights, selection and node creation.