Reimplemnting common data structures and algorithms