Fixed indentation.
Improved set_efficiency performance.
better style
Fixed count bug.