As organic material is compacted to form coal, which stages does it pass through, from first to last?