modify the powercal()
clean some bugs
clear bugs