added mapBy and tests