moved some logic into player class
merge