Updated algorithms.
Expanded some classes.