Some work on PSO, transferred some useful classes.