Changed reset function