move main code into loop so user can do repeat calculations