Wrote integration loop. No errors yet.