A9P3 code and test cases.