Fixed many bugs, improved performance a lot and added some new methods