Rewrote big parts of the code. Major changes in classes.