changed range in loop from 5 to 8