First working version finished. tested.