Added test cases from Appendix.