Initial code. Some are ported from old projects.