second attempt

function used