2014-10-08 v1--fixed some bugs.