changed forloop index type to match start and end types