Added try catch for solve button.

Makes sure user enters everything correctly.