finished major working version