Error checking code, and program runs