moved player counting to single function outside of class