Add exception handling. Possibly using try and catch similiar to C?? A good detailed discussion will probably be needed before anything is added.