Problem Eight: added spec, implemented recursive solution