Implemented a solution for the fragmentation problem