Improving the timelimit code with proper exceptions