added sample code used and licensing for apache