added parameters for wei functio