Huge changes

- Logic has changed
- Variables are better named
- several bug fixes