Wrote the cod e for ex 18