enhancements to readability
and fixed end of turn index overstep