Code for the kata in classes