First working version

And my dislike for Java grows...