first working version; attempted to get rid of the deprecated collection helper not totally succesful; classes missing.