created exceptions and some exception handling