testing and code tuning

testing and code tuning