Some improvements. Testing works now.