assn 3: functional reverse and associated test