general algorithms, data structures and other stuff