Replaced setPlayer function with the constructor.