my implementation of various stl features