Improved the power scripts and re-wrote the power files