basically do reference implementation