added initial implementation and tests