reset function working for all games