Adjusted for loops so they arent shit