Initial commit of version2 by Bo Sundman.