now using exception handling instead of if/else when checking valid menu input; added docstrings