added collector class and tests