my answer to exercise 43 from Zed Shaw's LPTHW