Moved previous win function
Merge branch 'master' into xep-0223