add appendix with pair of algorithms proving 4n-4 bound