Formation of methane and hydrocarbons by pyrolysis of immature kerogens