changed the loop in raw