Pieces of code useful for numerics