implement and verify a bunch of stl <algorithm>s