nearly stable working version now