Rearranged some of the packages. Added an exception class to handle
invalid depth.