Added code snippet to appendix