trying to figure out why my loop wont work