Move allocation to inside loop for each input power