Finishing the 'Rewrite using modules' solution