Base code. First version.