Improved error handling using throws. Working.