code for exception puzzlers