Added some bad error handling and some oprator precedences