First version of code.