Actual code for restricting index range calc to last one and deflector.