edited modify function