use global var, implemented getFactionScores func, remove/move test stuff,  close connection with db