insertFrom method implementation modified