Slightly re-structured and re-styled a for-loop for greater understandability.
In shift_active_win() slightly improved formatting and solved a "why is this needed" comment question.