implemented function code