edit fucntion corrected