Eliminated extract() to make code easier to follow.