finished error checking

We need to add winning function