added yalin's code.  starting to look at integration