writing checker code