Initial commit with some functions broken out.