Added function code