added documentation and win checks