weaved some rbf code
improved weaving