added initial reference implementation