Revert "Indent and remove cpu loop"

This reverts commit ae655aef2c158b1e50a958a8b737ccc8a78ed2ad.