Fixed a lot of bugs. It still doesn't work.