second implementation has been updated