updated tests, all passing
added error-catching for empty and non-digit input, created final function