Added the entire loop

Still doesn't appear to be working correctly