added some function snippet