First working version

Feature complete