Use range instead of writing 7 assign statements