added error check to public

put error check in public, added do while, changed from void to bool,
moved error check from process to do-while loop to loop the input if
there are errors in the input