Adding code for removing edge and re-structuring file