add more classes, improved derivatives method