added function code