modifyValue function to be written