Code for a lab on exceptions