added code snipets