Implemented main class and exception class