working first-fit and holes merging correctly