added extraction function.