add version 2 implementation