Implementations of various algorithms and useful functions/objects