Did some rearranging and added power manager.