Re-Wrote Loops

I rewrote some loops