added constructor and checkNumber function