added some reference implementation