Wrote the findNum() function.