Added surrender,fixed doubling logic, some better error handling