mobved more inside for loops to avoide errors.