First version

First version of my work. Many known bugs but it works.