buncha fixes. for loop mostly