Now fully working

But it's kind of a mess. I don't like it.