Initial working test. Still needs cleanup.