fixed second play problem in algorithm