Added aggreagte/ex.h and a major bug fix