Combined my code with yours

Combined my code and fixed a lot of syntax things. Began writing custom
exceptions.