Forensic engineering includes the investigation of materials, products, structures or components that fail or do not operate or function as intended, causing personal injury, damage to property or economic loss. The consequences of failure may give rise to an action under either criminal or civil law including but not limited to health and safety legislation, the laws of contract and/or product liability and the laws of tort. The field also deals with retracing processes and procedures leading to accidents in the operation of vehicles or machinery. Generally, the purpose of forensic engineering investigations is to locate the cause or causes of failure with a view to improving performance or the life of a component or to assist a court in determining the facts of an accident. It can also involve investigation into intellectual property claims, especially patents.