Moved player code into new file