Working tennis game in erlang