Rewritten player functions to use new class