dp return correct value and file reorganization - working