Added all code start to finish (input, error handling, computation, output)