added new extractCast() functions
added extract_test to test the extraction functions