Errors corrected, added some comments

Corrected stupid error evaluating powerStatus variable